class Weapon(object):
    ranks = ["青铜","白银","黄金","钻石"]
    # weapon_list作为 类的属性
    weapon_list = []

    def __init__(self, name, damage, rank):
        self.name = name
        self.damage = damage
        if rank not in Weapon.ranks:
            raise Exception("品阶异常")
        else:
            self.rank = rank
        Weapon.weapon_list.append(self)

    def show(self):
        print(f"{self.name} ： {self.damage}攻击力\t 品阶-{self.rank}")

    @classmethod
    def get_max_damage(cls):
        max_damage = 0
        for weapon in cls.weapon_list:
            if weapon.damage > max_damage:
                max_damage = weapon.damage
        return max_damage

user = Weapon('黑龙歼灭刀',1000,"钻石")
print(Weapon.get_max_damage())